package com.wedu.view;

import com.alibaba.druid.sql.PagerUtils;
import com.wedu.entity.Student;
import com.wedu.service.StudentService;
import com.wedu.service.impl.StudentServiceImpl;
import org.junit.Test;

import java.util.Scanner;

//用户界面UI
public class Login {
        private StudentService studentService = new StudentServiceImpl();
        private Scanner sc = new Scanner(System.in);

        //登录测试
        @Test
        public void login() {
            //1.键盘录入，接收用户名和密码
            System.out.println("请输入用户名：");
            String name = sc.nextLine();
            System.out.println("请输入密码：");
            String password = sc.nextLine();
            //2.调用方法
            boolean flag = studentService.loginStu(name, password);
            //3.判断结果，输出不同语句
            if (flag) {
                //登录成功
                System.out.println("登录成功！");
            } else {
                System.out.println("用户名或密码错误！");
            }
        }

        //根据id查找学生

}
